using System;

namespace CodeStory.Core.UI
{
	public class CodeStoryUserControl : System.Web.UI.UserControl
	{

		public CodeStoryUserControl() {
			AppRelativeTemplateSourceDirectory = TempAppRelativeTemplateSourceDirectory;
		}

		/// <summary>
		/// Gets the temp app relative template source directory.
		/// </summary>
		/// <value>The temp app relative template source directory.</value>
		public string TempAppRelativeTemplateSourceDirectory {
			get {
				object p = Context.Items[PageHierarchyBuilder.AppRelativeTemplateSourceDirectoryDataKey];
				if (p == null) {
					p = AppRelativeTemplateSourceDirectory;
				}
				return p.ToString();
			}
		}

		/// <summary>
		/// Gets the module path.
		/// </summary>
		/// <value>The module path.</value>
		public string ModulePath {
			get {
				object p = Context.Items[PageHierarchyBuilder.AppRelativeTemplateSourceDirectoryDataKey];
				if (p == null) {
					p = AppRelativeTemplateSourceDirectory;
				}
				string path = p.ToString();
				return path.Substring(2);
			}
		}
		
	}
}